//package com.igeekhome.tool;
//
//
//import org.springframework.ui.Model;
//import org.springframework.web.servlet.HandlerInterceptor;
//import org.springframework.web.servlet.ModelAndView;
//
///**
// * 这是个拦截器
// */
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//import javax.servlet.http.HttpSession;
//
//public class Filter implements HandlerInterceptor
//{
//    /**请求前调用
//     *
//     * @param request  请求对象
//     * @param response  响应对象
//     * @param handler
//     * @return
//     * @throws Exception
//     */
//    @Override
//    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception
//    {
//        HttpSession session=request.getSession();
//        System.out.println(request.getRequestURL());
//        System.out.println(request.getPathInfo());
//        //session.removeAttribute("check");
//        if(session.getAttribute("check")==null)
//        {
////            System.out.println("////////////////////////////////////////////////////////////");
//            session.setAttribute("errormsg","无法正常访问eee!");
//            response.sendRedirect("error-404");
//        }
//        return true;
//    }
//    //控制器操作之后
//    @Override
//     public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,  ModelAndView modelAndView) throws Exception
//    {
//    }
//    //模板页面之前
//    @Override
//    public  void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler,  Exception ex) throws Exception
//    {
//    }
//
//}
